package com.drinks.yiniang.adapter.category;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseViewHolder;
import com.drinks.yiniang.R;
import com.drinks.yiniang.adapter.base.BaseMultiItemQuickRCVAdapter;
import com.drinks.yiniang.adapter.base.BaseQuickRCVAdapter;
import com.drinks.yiniang.entity.category.CategoryJson;
import com.drinks.yiniang.entity.goods.HomeGoodsJson;
import com.drinks.yiniang.utils.GlideUtils;
import com.hansen.library.ui.widget.image.RatioRoundImageView;
import com.hansen.library.ui.widget.image.SquareImageView;

import java.util.ArrayList;
import java.util.List;

import static com.drinks.yiniang.entity.category.CategoryJson.TYPE_ITEM_CATEGORY_BANNER;
import static com.drinks.yiniang.entity.category.CategoryJson.TYPE_ITEM_CATEGORY_LIST;

/**
 * 首页分类列表adapter
 *
 * @author han
 * @date 2019/8/30
 */
public class CategoryPageAdapter extends BaseQuickRCVAdapter<CategoryJson.CategoryList, BaseViewHolder> {

    public CategoryPageAdapter(Context mContext, @Nullable List<CategoryJson.CategoryList> data) {
        super(R.layout.item_category_page, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CategoryJson.CategoryList item) {
        GlideUtils.loadSquareImage(mContext, (SquareImageView) helper.getView(R.id.iv_category_icon), item.getIcon_url());

        helper.setText(R.id.tv_category_name, item.getName());
    }
}
